Skip to content

feat(seer): Add GitLab support to seer preferences endpoint#115424

Draft
billyvg wants to merge 1 commit into
masterfrom
bvong/seer-gitlab-preferences-support
Draft

feat(seer): Add GitLab support to seer preferences endpoint#115424
billyvg wants to merge 1 commit into
masterfrom
bvong/seer-gitlab-preferences-support

Conversation

@billyvg
Copy link
Copy Markdown
Member

@billyvg billyvg commented May 12, 2026

Summary

  • Adds conditional GitLab SCM provider support to the project seer preferences endpoint (/api/0/projects/{org}/{project}/seer/preferences/), gated behind the existing organizations:seer-gitlab-support feature flag
  • When the flag is enabled, POST accepts "gitlab" and "integrations:gitlab" provider strings, and GET includes GitLab repos from code mappings in the response
  • Introduces get_supported_scm_providers(organization) helper in seer/constants.py that conditionally extends the provider list — the static SEER_SUPPORTED_SCM_PROVIDERS list is unchanged for other consumers

Changes

  • src/sentry/seer/constants.py — Added get_supported_scm_providers(), SEER_GITLAB_SCM_PROVIDERS, and expanded SeerSCMProvider type
  • src/sentry/seer/endpoints/project_seer_preferences.py — Overrode validate_provider on RepositorySerializer to use org-aware provider list; passed org context to serializer
  • src/sentry/seer/autofix/utils.pyget_autofix_repos_from_project_code_mappings() now uses get_supported_scm_providers() instead of static list

Test plan

  • Added test_post_accepts_gitlab_repo_with_feature_flag — POST with integrations:gitlab succeeds when flag is on
  • Added test_post_accepts_gitlab_bare_provider_with_feature_flag — POST with bare gitlab provider succeeds when flag is on
  • Existing test_post_rejects_unsupported_repo_provider covers the flag-off case (sends gitlab, expects 400)
  • Added test_includes_gitlab_repos_with_feature_flag — code mapping repos include GitLab when flag is on
  • Existing test_filters_out_unsupported_providers covers flag-off case for code mappings
  • All 27 tests pass locally

Add conditional GitLab SCM provider support to the project seer
preferences endpoint, gated behind the existing
organizations:seer-gitlab-support feature flag.

When the flag is enabled on an org, the POST endpoint accepts GitLab
repos (both 'gitlab' and 'integrations:gitlab' provider strings) and
the GET endpoint includes GitLab repos from code mappings in the
response.

Introduces get_supported_scm_providers() helper that returns the base
GitHub provider list extended with GitLab providers when the flag is
active. The static SEER_SUPPORTED_SCM_PROVIDERS list remains unchanged
for other consumers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant